<script type="text/javascript">
	$(document).ready(function() {	});
	function laporan(pageURL, title,w,h){
		var periode_awal=document.getElementById('tanggal_awal').value;
		var periode_akhir=document.getElementById('tanggal_akhir').value;
		if ((periode_awal=='')||(periode_akhir=='')){
			alert('Isilah periode awal dan akhir');
		}else{
			var left = (screen.width/2)-(w/2);
			var top = (screen.height/2)-(h/2);
			var targetWin = window.open ('<?=site_url();?>/laporan_laba_rugi/view_lap_laba_rugi_periode/'+periode_awal+'/'+periode_akhir, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
			
			document.getElementById('tanggal_awal').value='';
			document.getElementById('tanggal_akhir').value='';
		}	}
	
	$(function(){
		$("#tanggal_awal").datepicker({dateFormat: 'yy-mm-dd' });
	})	
	
	$(function(){
		$("#tanggal_akhir").datepicker({dateFormat: 'yy-mm-dd' });
	})	
	
		
	function klick_tanggal_awal(){
		var tanggal = document.getElementById("tanggal_awal");
		tanggal.focus();
	}
	
	function klick_tanggal_akhir(){
		var tanggal = document.getElementById("tanggal_akhir");
		tanggal.focus();
	}
	
	function batal(){
		document.location.href="<?=site_url();?>/dashboard";
	}
	
</script>

<div id="page-heading"><h1>Laporan Surflus Defisit</h1></div>
			<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
				<?php
					$attributes = array('name' => 'form1', 'id' => 'form1', 'class'=>'block-content form');
					echo form_open('laporan_laba_rugi/view_lap_laba_rugi_periode', $attributes);
				?>
				<input type="hidden" name="id_laba_rugi" id="id_laba_rugi" value="<?=date('YmdHis')?>">
				<tr>
					<th rowspan="3" class="sized"><img src="<?php echo base_url() ?>asset/admin/images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
					<th class="topleft"></th>
					<td id="tbl-border-top">&nbsp;</td>
					<th class="topright"></th>
					<th rowspan="3" class="sized"><img src="<?php echo base_url() ?>asset/admin/images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
				</tr>	
				
				<tr>
					<td id="tbl-border-left"></td>
					<td>
					<!--  start content-table-inner -->
					<div id="content-table-inner">
		<div id="table-content">
					<table border="0" width="100%" cellpadding="0" cellspacing="0">
					<tr valign="top">
					<td>
						<!--  start step-holder -->
						<div id="step-holder">
							<div class="step-no">1</div>
							<div class="step-dark-left">Laporan Surflus Defisit</div>
							<div class="step-dark-round">&nbsp;</div>
							<div class="clear"></div>
						</div>
						<!--  end step-holder -->
					
						<!-- start id-form -->
						<table border="0" cellpadding="0" cellspacing="0"  id="id-form">
						<tr>
							<th valign="top">Periode (*) :</th>
							<td><span class="relative">
										<span class="input-type-text margin-right relative"><input type="text" name="periode_awal" id="tanggal_awal" class="inp-form">  
										<img onclick="javascript:klick_tanggal_awal()" src="<?=base_url()?>asset/admin/images/icons/fugue/calendar-month.png" width="16" height="16"></span>
								</span></td>
							<td>&nbsp; &nbsp; &nbsp; &nbsp; s/d &nbsp; &nbsp; &nbsp;</td>
							<td>
								<span class="relative">
										<span class="input-type-text margin-right relative"><input type="text" name="periode_akhir" id="tanggal_akhir" class="inp-form">  
										<img onclick="javascript:klick_tanggal_akhir()" src="<?=base_url()?>asset/admin/images/icons/fugue/calendar-month.png" width="16" height="16"></span>
								</span>
							</td>
						</tr>
						
	
						<tr>
							<th>&nbsp;</th>
							<td valign="top">
								
								<button class="form-submit" type="button" onclick="laporan('<?=site_url();?>/laporan_laba_rugi/view_lap_laba_rugi_periode/','name',1000,800)">Preview</button> 
								<button class="form-reset" type="button" class="red" onclick="javascript:batal()">Batal</button> 

							</td>
							<td colspan="2"></td>
							
						</tr>
						</table>
						<!-- end id-form  -->

					</td>
					</tr>
				
					</table>
					<div class="clear"></div>
					</div>
		
					</td>
					<td id="tbl-border-right"></td>
				</tr>
				<tr>
					<td class="sized bottomleft"></td>
					<td height="15px" id="tbl-border-bottom"></td>
					<td class="sized bottomright"></td>
				</tr>
				</form>
			</table>




